SUBROUTINE CHECKBOX
     *Display a simple form with one group of checkboxes, each box with the same name

     * Include the RealWeb definitions
     INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP

     * Start the HTML page.
     * Display the text 'Form with Checkboxes' in the browser's title bar.
     CALL RW_START_HTML_PAGE("Form with Checkboxes", "", "", "", "")

     CALL RW_PUT("Please check the relevant boxes to indicate which " : ...
        "course modules you require")

     * Start the HTML form, specifying that the subroutine RESPONSE should
     * be run when the submit button is clicked.
     CALL RW_START_HTML_FORM("RESPONSE","FORM5","")
     
     CALL RW_NEWLINE
     CALL RW_CHECKBOX("module","Word Processing",0,0,"")
     CALL RW_PUT("Word Processing")
     CALL RW_NEWLINE
     CALL RW_CHECKBOX("module","Spreadsheets",0,0,"")
     CALL RW_PUT("Spreadsheets")
     CALL RW_NEWLINE
     CALL RW_CHECKBOX("module","Databases",0,0,"")
     CALL RW_PUT("Databases")
     CALL RW_NEWLINE
     CALL RW_CHECKBOX("module","Web Page Design",0,0,"")
     CALL RW_PUT("Web Page Design")
     CALL RW_NEWLINES(2)

     CALL RW_RESET("CLEAR","Clear Selections","")
     *Create the submit button
     CALL RW_SUBMIT_BUTTON("Submit Details","")
     *Complete the form
     CALL RW_END_FORM

     * Complete the page
     CALL RW_END_PAGE
RETURN
SUBROUTINE RESPONSE
     *Display message acknowledging selected modules to user submitting Form

     * Include the RealWeb definitions
     INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP

     EQU VM TO CHAR(253)

     * Start the HTML page.
     * Display the text 'Response to Form' in the browser's title bar.
     CALL RW_START_HTML_PAGE("Response to Form", "", "", "", "")

     CALL RW_PUT("Thank you for your selections")
     CALL RW_NEWLINE

     *Get the value of "module" from the form
     *Multiple checkboxes may be have been selected, so the value returned
     *will be a string of all selected modules separated by Value Marks 
     CALL RW_GET_PARAM("module", MODULES)

     IF MODULES NE "" THEN
          MODULES2 = CHANGE(MODULES, VM, ", ")
          CALL RW_PUT('We will send you the following modules "':MODULES2:'"')
     END

     * Complete the page.
     CALL RW_END_PAGE
RETURN

Go to top button